package com.geekca.d8.testlist;

import java.util.ArrayList;

public class TestMovie {
    public static void main(String[] args) {
        ArrayList<Movie> movies = new ArrayList<>();
        Movie movie1 = new Movie();
        Movie movie2 = new Movie();
        Movie movie3 = new Movie();

        movie1.setName("阿甘正传");
        movie1.setActor("汤.汉克斯");
        movie1.setScore(9.5);

        movie2.setName("霸王别姬");
        movie2.setActor("张国荣");
        movie2.setScore(9.0);

        movie3.setName("肖申克的救赎");
        movie3.setActor("罗宾斯");
        movie3.setScore(9.9);

        movies.add(movie1);
        movies.add(movie2);
        movies.add(movie3);
        movies.add(new Movie("让子弹飞","姜文",9.7));

//        System.out.println(movies);
        for (int i = 0; i < movies.size(); i++) {
//            System.out.print(movies.get(i).getName() + " ");
            System.out.println(movies.get(i));
        }
    }
}
